package com.yanqu.road.entity.activity.shuihuyezipai;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Description 叶子牌房间信息
 * @Author cwq
 * @Data 2021/11/30 18:20
 */
@FieldTypeAnnotation(tableName = "t_u_activity_shuihuyezicard_room_user_data")
public class ShuiHuYeZiCardRoomData extends DataObject {
    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "玩家一id, pve 才有",select = true, update = true)
    private long userId;
    @FieldTypeAnnotation(desc = "当前回合, 从 1 开始")
    private int round;
    @FieldTypeAnnotation(desc = "房间类型id, pve 才有")
    private int roomId;
    @FieldTypeAnnotation(desc = "开房时的段位积分, pve 才有")
    private int rankScore;
    @FieldTypeAnnotation(desc = "当前的ai模型index  0  1  2, pve 才有")
    private int aiModelIndex;
    @FieldTypeAnnotation(desc = "npcId 用来显示npc形象, pve 才有")
    private int npcId;
    @FieldTypeAnnotation(desc = "玩家当前手牌,k:玩家id/npcId k:卡牌id,v:卡牌信息")
    private Map<Long,Map<Integer,ShuiHuYeZiCardBattleCard>> userCardMap = new ConcurrentHashMap<>();
    @FieldTypeAnnotation(desc = "上一轮获胜的玩家id")
    private long lastRoundWinnerId;
    @FieldTypeAnnotation(desc = "当前buff事件id")
    private int buffId;
    @FieldTypeAnnotation(desc = "当前buff事件剩余次数")
    private int num;
    @FieldTypeAnnotation(desc = "下个事件id")
    private int nextBuffId;
    @FieldTypeAnnotation(desc = "弃牌")
    private List<ShuiHuYeZiCardDiscardCard> discardList = new ArrayList<>();
    @FieldTypeAnnotation(desc = "记录")
    private List<ShuiHuYeZiCardPlayRecord> recordList = new ArrayList<>();
    @FieldTypeAnnotation(desc = "开始时间 ms")
    private long startTime;

    public int getActivityId() {
        return activityId;
    }
    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public long getUserId() {
        return userId;
    }
    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public int getRound() {
        return round;
    }
    public void setRound(int round) {
        if (this.round != round) {
            this.round = round;
            setOp(DataStatus.Update);
        }
    }

    public int getRoomId() {
        return roomId;
    }

    public void setRoomId(int roomId) {
        if (this.roomId != roomId) {
            this.roomId = roomId;
            setOp(DataStatus.Update);
        }
    }

    public int getRankScore() {
        return rankScore;
    }
    public void setRankScore(int rankScore) {
        if (this.rankScore != rankScore) {
            this.rankScore = rankScore;
            setOp(DataStatus.Update);
        }
    }

    public int getAiModelIndex() {
        return aiModelIndex;
    }
    public void setAiModelIndex(int aiModelIndex) {
        if (this.aiModelIndex != aiModelIndex) {
            this.aiModelIndex = aiModelIndex;
            setOp(DataStatus.Update);
        }
    }

    public int getNpcId() {
        return npcId;
    }

    public void setNpcId(int npcId) {
        if (this.npcId != npcId) {
            this.npcId = npcId;
            setOp(DataStatus.Update);
        }
    }

    public Map<Long, Map<Integer, ShuiHuYeZiCardBattleCard>> getUserCardMap() {
        return userCardMap;
    }
    public void setUserCardMap(Map<Long, Map<Integer, ShuiHuYeZiCardBattleCard>> userCardMap) {
        if (null == userCardMap){
            return;
        }
        if (this.userCardMap == null || !this.userCardMap.equals(userCardMap)) {
            this.userCardMap = userCardMap;
            setOp(DataStatus.Update);
        }
    }

    public long getLastRoundWinnerId() {
        return lastRoundWinnerId;
    }
    public void setLastRoundWinnerId(long lastRoundWinnerId) {
        if (this.lastRoundWinnerId != lastRoundWinnerId) {
            this.lastRoundWinnerId = lastRoundWinnerId;
            setOp(DataStatus.Update);
        }
    }

    public int getBuffId() {
        return buffId;
    }
    public void setBuffId(int buffId) {
        if (this.buffId != buffId) {
            this.buffId = buffId;
            setOp(DataStatus.Update);
        }
    }

    public int getNum() {
        return num;
    }
    public void setNum(int num) {
        if (this.num != num) {
            this.num = num;
            setOp(DataStatus.Update);
        }
    }

    public int getNextBuffId() {
        return nextBuffId;
    }
    public void setNextBuffId(int nextBuffId) {
        if (this.nextBuffId != nextBuffId) {
            this.nextBuffId = nextBuffId;
            setOp(DataStatus.Update);
        }
    }

    public List<ShuiHuYeZiCardDiscardCard> getDiscardList() {
        return discardList;
    }
    public void setDiscardList(List<ShuiHuYeZiCardDiscardCard> discardList) {
        if (null == discardList){
            return;
        }
        if (this.discardList == null || !this.discardList.equals(discardList)) {
            this.discardList = discardList;
            setOp(DataStatus.Update);
        }
    }

    public List<ShuiHuYeZiCardPlayRecord> getRecordList() {
        return recordList;
    }
    public void setRecordList(List<ShuiHuYeZiCardPlayRecord> recordList) {
        if (null == recordList){
            return;
        }
        if (this.recordList == null || !this.recordList.equals(recordList)) {
            this.recordList = recordList;
            setOp(DataStatus.Update);
        }
    }

    public long getStartTime() {
        return startTime;
    }
    public void setStartTime(long startTime) {
        if (this.startTime != startTime) {
            this.startTime = startTime;
            setOp(DataStatus.Update);
        }
    }
}
